<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/8/22
  Time: 11:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <%--<meta http-equiv="Access-Control-Allow-Origin" content="open.weixin.qq.com">--%>
    <title>新途微助手</title>
    <%@include file="../../../include/header.jsp" %>
    <style>
        .item-title span{
            color:#0E8F0E
        }
    </style>
</head>
<body>
<!-- Status bar overlay for full screen mode (PhoneGap) -->
<div class="statusbar-overlay"></div>
<!-- Panels overlay-->
<div class="panel-overlay"></div>
<!-- Views -->
<div class="views">
    <!-- Your main view, should have "view-main" class -->
    <div class="view view-main">
        <!-- Top Navbar-->
        <div class="navbar">
            <div class="navbar-inner">
                <!-- We need cool sliding animation on title element, so we have additional "sliding" class -->
                <div class="left">
                    <a class="link" onClick="targetPage()" id="back"><i class="icon icon-back"></i><span>返回</span></a>
                </div>
                <div class="center sliding">订单详情</div>
                <div class="right" id="sellerShop"></div>
            </div>
        </div>
        <!-- Pages container, because we use fixed-through navbar and toolbar, it has additional appropriate classes-->
        <div class="pages navbar-through toolbar-through">
            <!-- Page, "data-page" contains page name -->
            <div data-page="index" class="page page-content" id="content">
                <!-- Scrollable page content -->
            </div>
        </div>
    </div>
</div>

<%@include file="../../../include/footer.jsp" %>
<script src="${ctx}/static/template7/dist/template7.js"></script>
<script type="text/template7" id="content-module">
    <div class="content-block-title">订单信息</div>
    <div class="list-block">
        <ul>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">订单号:<span>${param.orderNumber}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">数量:<span>{{order.amount}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">折扣:<span>{{order.discount}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">专享价:<span>{{order.price}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">纽币价:<span>{{order.nzdPrice}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">总金额:<span>{{order.amountPrice}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">备注:<span>{{order.remark}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">支付时间:<span>{{order.payDate}}</span></div>
                </div>
            </li>
        </ul>
    </div>

    <div class="content-block-title">商家信息</div>
    <div class="list-block">
        <ul>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">商家名称:<span>{{seller.name}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">商家电话:<span>{{seller.phone}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">商家邮箱:<span>{{seller.email}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">是否需预约:<span>{{seller.yuyue}}</span></div>
                </div>
            </li>
        </ul>
    </div>

    <div class="content-block-title">商品信息</div>
    <div class="list-block">
        <ul>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">商品名称:<span>{{commodity.name}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">截止兑换日期:<span>{{commodity.endDate}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">商品兑换码:<span>{{commodity.verifyCode}}</span></div>
                </div>
            </li>
        </ul>
    </div>

    <div class="content-block-title">景点信息</div>
    <div class="list-block">
        <ul>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">景点名称:<span>{{spot.name}}</span></div>
                </div>
            </li>
            <li class="item-content">
                <div class="item-inner">
                    <div class="item-title">景点地址:<span>{{spot.address}}</span></div>
                </div>
            </li>
        </ul>
    </div>
</script>
<script>
    var myApp = new Framework7();
    var $$ = Framework7.$;
    var mainView = myApp.addView('.view-main');
    var orderNumber = '${param.orderNumber}';
    if(orderNumber){
        var para = {
            orderNumber:orderNumber
        }
        $.post(Constant.ctx("/mulanweb/admin/order/getDetail"),para,function(info){
           var module = $("#content-module").html();
            var templateCompile = Template7.compile(module);
            var loadModuleDate = templateCompile(info);
            $("#content").html(loadModuleDate);
            $(".item-content").on("click",function(e){
                var title = $(this).find("div.item-title").html().split(":")[0];
                var content =$(this).find("span").html();
                Constant.alert(content,title);
            });
        });
    }else{
        // todo 跳转到订单列表页
    }
    function targetPage() {
            WeixinJSBridge.call('closeWindow');
    }

</script>
</body>
</html>
